package com.lm.action.plane;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.ServletActionContext;

import com.lm.entity.bean.PlanItinerary;
import com.lm.entity.vo.plane.ItineraryVO;
import com.lm.framework.adapater.LmBaseAction;
import com.lm.services.iface.plane.IPlanItineraryService;
import com.lm.utils.Const;
import com.lm.utils.page.PageBean;
public class PlanItineraryAction extends LmBaseAction {

	private static final long serialVersionUID = -1332752735778073769L;
	private ItineraryVO vo = new ItineraryVO();
	private IPlanItineraryService itineraryService;
	private PlanItinerary item = new PlanItinerary();

	public PlanItinerary getItem() {
		return item;
	}

	public void setItem(PlanItinerary item) {
		this.item = item;
	}

	public ItineraryVO getVo() {
		return vo;
	}

	public void setVo(ItineraryVO vo) {
		this.vo = vo;
	}

	public IPlanItineraryService getItineraryService() {
		return itineraryService;
	}

	public void setItineraryService(IPlanItineraryService itineraryService) {
		this.itineraryService = itineraryService;
	}

	public String doSearch() {
		PageBean pb = getPageBean();
		vo.setItinerarys(itineraryService.getList(item, pb));
		vo.setPageBean(pb);
		return Const.SUCCESS;
	}

	public String doUpdate() {
		HttpServletRequest request = ServletActionContext.getRequest();
		HttpServletResponse response = ServletActionContext.getResponse();
		item.setId(Integer.valueOf((request.getParameter("ItId"))));
		String Istatus = request.getParameter("Istatus");
		item.setStatus(Integer.parseInt(request.getParameter("Istatus")));
		itineraryService.updateParentOrder(item);
		return "result";
	}
}
